package com.milesOne.model;

import com.alibaba.fastjson.JSON;
import com.milesOne.beans.DataBean;
import com.milesOne.nutzUtils.NutzConfig;
import org.nutz.dao.Dao;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * java、8 新的时间类型与数据库对应
 * */
public class DataTime {

    private static Dao dao = NutzConfig.getInstance();

    public static void main(String[] args) {
        DataTime dataTime = new DataTime();
        dataTime.getBeanByMysql();
    }

    public void getBeanByMysql(){
        DataBean bean = dao.fetch(DataBean.class);

        System.err.println(JSON.toJSONString(bean));
        System.err.println(JSON.toJSONString(bean.getTest_time().getTime()));


    }



}
